{extend name="main"}
{block name="style"}
<style type="text/css">
	.el-input-group__prepend{padding: 0;}
	.el-input-group__prepend .el-cascader{line-height: 36px;min-width: 150px;}
	.el-input-group__prepend .el-input__inner{height: 36px;border: 0;}
    .search-bg{background-image: url(__TEMPLATE_STATIC__/home_searchbar_img_bg.png);background-size: 100% 100%;}
    .el-table td, .el-table th{vertical-align: baseline;}
</style>
{/block}
{block name="header"}
{include file="module/top_nav" container="container-xl"/}
{include file="module/header_concise"/}
{/block}
{block name="body"}
<div class="container-xl">
	<div class="search py-4 flex flex-center">
		{empty name="logo"}
		<a href="/" class="logo">
			<img src="{xycms:web name="logo"}">
		</a>
		{else/}
		<a href="/" class="logo">
			<img src="{$logo}">
		</a>
		{/empty}
		<div class="flex-1 pl-5">
			<el-form @submit.native.prevent="setSearchItemKey" class="shadow">
				<el-input placeholder="请输入关键字" v-model="search.key" class="input-with-select el-input__inner-left-none shadow"
				clearable>
				  	<el-cascader
					    v-model="cid"
					    :options="jobscatelist"
					    placeholder="职位分类"
					    :props="defaultProps"
					    filterable
					    clearable
					    :show-all-levels="false"
					     slot="prepend"
					     @change="setSearchItemCid">
				    </el-cascader>
				    <el-button native-type="submit" slot="append">搜索</el-button>
				</el-input>
			</el-form>
			<div class="flex pt-2">
				<div class="text-grey">热门搜索：</div>
				<div class="px-2"><a href="/jobs?key=普工" target="_blank">普工</a></div>
				<div class="px-2"><a href="/jobs?key=销售" target="_blank">销售</a></div>
				<div class="px-2"><a href="/jobs?key=司机" target="_blank">司机</a></div>
				<div class="px-2"><a href="/jobs?key=文员" target="_blank">文员</a></div>
				<div class="px-2"><a href="/jobs?key=管理" target="_blank">管理</a></div>
				<div class="px-2"><a href="/jobs?key=业务员" target="_blank">业务员</a></div>
				<div class="px-2"><a href="/jobs?key=设计" target="_blank">设计</a></div>
				<div class="px-2"><a href="/jobs?key=收银" target="_blank">收银</a></div>
				<div class="px-2"><a href="/jobs?key=服务员" target="_blank">服务员</a></div>
				<div class="px-2"><a href="/jobs?key=导购" target="_blank">导购</a></div>
				<div class="px-2"><a href="/jobs?key=会计" target="_blank">会计</a></div>
			</div>
		</div>
	</div>
</div>
<div class="container-xl position-relative text-666666">
	<div class="bg-white shadow p-3">
		<div class="flex border-bottom border-grey">
			<div class="w-100px py-3">工作区域：</div>
			<div class="flex-1 overflow-hidden"
			:style="showAllCity?'height:auto;':'height:40px'">
				<div v-if="arealist">
					<div class="row" v-if="arealist.length>1">
						<div class="col-auto pr-3 py-3 pointer text-primary-hover" @click="setSearchItemCity('')">
							<span class="px-2 py-1" :class="{'text-white bg-primary rounded':(search.province==''&&search.city==''&&search.area=='')}">不限</span>
						</div>
						<div class="col-auto pr-3 py-3 pointer text-primary-hover" v-for="(v,index) in arealist" @click="setSearchItemCity(v)">
							<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.province==v.id}">{{v.title}}</span>
						</div>
					</div>
					<div class="row" v-else-if="arealist[0].data.length>1">
						<div class="col-auto pr-3 py-3 pointer text-primary-hover" @click="setSearchItemCity('')">
							<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.city==''}">不限</span>
						</div>
						<div class="col-auto pr-3 py-3 pointer text-primary-hover" v-for="(v,index) in arealist[0].data" @click="setSearchItemCity(v)">
							<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.city==v.id}">{{v.title}}</span>
						</div>
					</div>
					<div class="row" v-else-if="arealist[0].data[0].data.length>1">
						<div class="col-auto pr-3 py-3 pointer text-primary-hover" @click="setSearchItemCity('')">
							<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.area==''}">不限</span>
						</div>
						<div class="col-auto pr-3 py-3 pointer text-primary-hover" v-for="(v,index) in arealist[0].data[0].data" @click="setSearchItemCity(v)">
							<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.area==v.id}">{{v.title}}</span>
						</div>
					</div>
				</div>
				<div class="row border-top border-grey" v-show="city.length">
					<div class="col-auto pr-3 py-3 pointer text-primary-hover" v-for="(v,index) in city" @click="setSearchItemCity(v)">
						<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.city==v.id}">{{v.title}}</span>
					</div>
				</div>
				<div class="row border-top border-grey" v-show="area.length">
					<div class="col-auto pr-3 py-3 pointer text-primary-hover" v-for="(v,index) in area" @click="setSearchItemCity(v)">
						<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.area==v.id}">{{v.title}}</span>
					</div>
				</div>
			</div>
			<div class="py-3 pointer" @click="showAllCity= !showAllCity;">更多<i class="el-icon-caret-top ml-2" v-if="showAllCity"></i><i class="el-icon-caret-bottom ml-2" v-else="showAllCity"></i></div>
		</div>
		<div class="flex flex-center border-bottom border-grey">
			<div class="w-100px">更新时间：</div>
			<div class="flex-1">
				<div class="row">
					<div class="col-auto pr-3 py-3 pointer text-primary-hover" @click="setSearchItemUpdateTime('')">
						<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.update_time===''}">不限</span>
					</div>
					<div class="col-auto pr-3 py-3 text-nowrap pointer text-primary-hover" v-for="(v,index) in update_time" @click="setSearchItemUpdateTime(v.value)">
						<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.update_time===v.value}">{{v.title}}</span>
					</div>
				</div>
			</div>
		</div>
		<div class="flex flex-center border-bottom border-grey">
			<div class="w-100px">工作性质：</div>
			<div class="flex-1">
				<div class="row">
					<div class="col-auto pr-3 py-3 pointer text-primary-hover" :class="{'text-primary':search.jobs_type===''}" @click="setSearchItemJobsType('')">
						<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.jobs_type===''}">不限</span>
					</div>
					<div class="col-auto pr-3 py-3 text-nowrap pointer text-primary-hover" v-for="(v,index) in jobs_type" @click="setSearchItemJobsType(v.value)">
						<span class="px-2 py-1" :class="{'text-white bg-primary rounded':search.jobs_type===v.value}">{{v.title}}</span>
					</div>
				</div>
			</div>
		</div>
		<div class="flex flex-center border-bottom border-grey">
			<div class="w-100px">职位薪资：</div>
			<div class="row">
				<div class="col-auto pr-3 py-3 pointer text-primary-hover" @click="setSearchItemSalary();">
					<div class="px-2 py-1" :class="{'text-white bg-primary rounded':search.salary_min===null&&search.salary_max===null}">
						<span>不限</span>
					</div>
				</div>
				<div class="col-auto pr-3 py-3 pointer text-primary-hover" v-for="(v,index) in salary" @click="setSearchItemSalary(v);">
					<div v-if="jobs_salary_show_type" class="px-2 py-1" :class="{'text-white bg-primary rounded':search.salary_min==v.salary_min&&search.salary_max==v.salary_max}">
						<span v-if="v.salary_min <= 0 && v.salary_max == 0">面议</span>
						<!-- <span v-else-if="v.salary_max>=100">{{v.salary_min}}元以上</span> -->
						<span v-else>{{v.salary_min}}-{{v.salary_max}}元</span>
					</div>
					<div v-else class="px-2 py-1" :class="{'text-white bg-primary rounded':search.salary_min==v.salary_min&&search.salary_max==v.salary_max}">
						<span v-if="v.salary_min <= 0 && v.salary_max ==0">面议</span>
						<!-- <span v-else-if="v.salary_max>=100">{{v.salary_min}}K以上</span> -->
						<span v-else>{{v.salary_min}}-{{v.salary_max}}K</span>
					</div>
				</div>
			</div>
		</div>
		<div class="flex flex-center">
			<div class="w-100px">更多筛选：</div>
			<div class="mr-3 py-1 px-2 pointer search-item" :class="{'text-FF8221':search.industry}">{{text.industry}}
				<i class="el-icon-caret-top ml-2"></i>
				<i class="el-icon-caret-bottom ml-2"></i>
				<div class="bg-white shadow-lg py-3 search-item-content text-666666"
				style="width: 400px;">
					<div class="row mx-0">
						<div class="col-6 px-3 py-1 pointer text-primary-hover" :class="{'text-primary':search.industry==0}" @click="setSearchItemIndustry({title:'所属行业',id:0})">不限</div>
						<div class="col-6 px-3 py-1 text-nowrap pointer text-primary-hover" v-for="(v,index) in industry" :class="{'text-primary':search.industry==v.id}" @click="setSearchItemIndustry(v)">{{v.title}}</div>
					</div>
				</div>
			</div>
			<div class="mr-3 py-1 px-2 pointer search-item" :class="{'text-FF8221':search.size_type!==''}">{{text.size_type}}
				<i class="el-icon-caret-top ml-2"></i>
				<i class="el-icon-caret-bottom ml-2"></i>
				<div class="bg-white shadow-lg py-3 search-item-content text-666666">
					<div class="px-3 py-1 pointer text-primary-hover" :class="{'text-primary':search.size_type===''}" @click="setSearchItemSizeType({title:'企业规模',value:''})">不限</div>
					<div class="px-3 py-1 pointer text-primary-hover" v-for="(v,index) in size_type" :class="{'text-primary':search.size_type===v.value}" @click="setSearchItemSizeType(v)">{{v.title}}</div>
				</div>
			</div>
			<div class="mr-3 py-1 px-2 pointer search-item" :class="{'text-FF8221':search.education_level!==''}">{{text.education_level}}
				<i class="el-icon-caret-top ml-2"></i>
				<i class="el-icon-caret-bottom ml-2"></i>
				<div class="bg-white shadow-lg py-3 search-item-content text-666666">
					<div class="px-3 py-1 pointer text-primary-hover" :class="{'text-primary':search.education_level===''}" @click="setSearchItemEducationLevel({title:'学历要求',value:''})">不限</div>
					<div class="px-3 py-1 pointer text-primary-hover" v-for="(v,index) in education_level" :class="{'text-primary':search.education_level===v.value}" @click="setSearchItemEducationLevel(v)">{{v.title}}</div>
				</div>
			</div>
			<div class="mr-3 py-1 px-2 pointer search-item" :class="{'text-FF8221':search.exp_level!==''}">{{text.exp_level}}
				<i class="el-icon-caret-top ml-2"></i>
				<i class="el-icon-caret-bottom ml-2"></i>
				<div class="bg-white shadow-lg py-3 search-item-content text-666666">
					<div class="px-3 py-1 pointer text-primary-hover" :class="{'text-primary':search.exp_level===''}" @click="setSearchItemExpLevel({title:'经验要求',value:''})">不限</div>
					<div class="px-3 py-1 pointer text-primary-hover" v-for="(v,index) in exp_level" :class="{'text-primary':search.exp_level===v.value}" @click="setSearchItemExpLevel(v)">{{v.title}}</div>
				</div>
			</div>
			<div class="mr-3 py-1 px-2 pointer search-item" :class="{'text-FF8221':search.finance}">{{text.finance}}
				<i class="el-icon-caret-top ml-2"></i>
				<i class="el-icon-caret-bottom ml-2"></i>
				<div class="bg-white shadow-lg py-3 search-item-content text-666666">
					<div class="px-3 py-1 pointer text-primary-hover" :class="{'text-primary':search.finance===''}" @click="setSearchItemFinance({title:'融资阶段',value:''})">不限</div>
					<div class="px-3 py-1 pointer text-primary-hover" v-for="(v,index) in finance" :class="{'text-primary':search.finance===v.value}" @click="setSearchItemFinance(v)">{{v.title}}</div>
				</div>
			</div>
			<div class="flex-1"></div>
			<div class="py-3 pointer" @click="clearSearchItem">清空筛选</div>
		</div>
	</div>
</div>
<div class="container-xl py-3">
	<div class="flex">
		<div class="flex-1 pr-3">
			<div class="bg-white flex px-3 py-2 flex-center shadow text-secondary">
				<div class="px-4 py-2 pointer active-item"
				:class="{'active text-dark':search.is_famous==0}"
				@click="setSearchItemIsFamous(0)">所有职位</div>
				<div class="px-4 py-2 pointer active-item"
				:class="{'active text-dark':search.is_famous==1}"
				@click="setSearchItemIsFamous(1)">名企招聘</div>
				<div class="flex-1"></div>
				<div class="px-4 pointer flex flex-center"
				:class="{'text-dark':search.prop=='default'||search.prop=='defaultasc'}" 
				@click="setSearchItemProp('default')">
					<div class="pr-1">综合排序</div>
					<img src="__TEMPLATE_STATIC__/icon/icon-caret-bottom.png"
					v-if="search.prop=='default'">
					<img src="__TEMPLATE_STATIC__/icon/icon-caret-bottom.png"
					v-else-if="search.prop=='defaultasc'" style="transform: rotateX(180deg);">
					<img src="__TEMPLATE_STATIC__/icon/icon-caret.png"
					v-else>
				</div>
				<div class="px-4 pointer flex flex-center" 
				:class="{'text-dark':search.prop=='update_time'||search.prop=='update_timeasc'}" 
				@click="setSearchItemProp('update_time')">
					<div class="pr-1">更新时间</div>
					<img src="__TEMPLATE_STATIC__/icon/icon-caret-bottom.png"
					v-if="search.prop=='update_time'">
					<img src="__TEMPLATE_STATIC__/icon/icon-caret-bottom.png"
					v-else-if="search.prop=='update_timeasc'" style="transform: rotateX(180deg);">
					<img src="__TEMPLATE_STATIC__/icon/icon-caret.png"
					v-else>
				</div>
				<div class="border-left px-4 border-grey">{{search.current_page}} / {{search.last_page}}</div>
				<div class="px-4 pointer flex flex-center"
				@click="listViewType= !listViewType">
					<i class="el-icon-menu text-grey"
					v-if="listViewType"></i>
					<img src="__TEMPLATE_STATIC__/icon/icon-menu-list.png" width="14" height="14" 
					v-else>
					<div class="pl-1">{{listViewType?'详情':'列表'}}</div>
				</div>
			</div>
			<div v-if="!listViewType">
				<div class="mt-3 bg-white shadow" v-if="list.length>0" v-for="(v,index) in list">
					<div class="p-4">
						<div class="flex">
							<div class="flex-2">
								<a :href="'/jobs/'+v.id+'.html'" target="_blank">
									<div class="h6 mb-0 text-dark font-weight-600 flex flex-center text-primary-hover">
										<div>{{v.title}}[{{v.jobs_city}}·{{v.jobs_area}}]</div>
							  			<img src="__TEMPLATE_STATIC__/icon/icon_recommend.png"
							  			class="ml-1" height="22" v-if="v.recommend">
							  			<img src="__TEMPLATE_STATIC__/icon/icon_urgent.png"
							  			class="ml-1" height="22" v-if="v.urgent">
							  			<img src="__TEMPLATE_STATIC__/icon/icon_top.png"
							  			class="ml-1" height="22" v-if="v.top">
							  			<img src="__TEMPLATE_STATIC__/icon/icon_new.png"
							  			class="ml-1" height="22" v-if="v.is_new">
									</div>
								</a>
								<div class="flex flex-center text-grey py-3">
									<div>{{v.education}}</div>
									<div class="border-left border-grey py-1 mx-2"></div>
									<div>{{v.exp_level}}</div>
								</div>
							</div>
							<div class="flex-1">
								<div class="h6 text-FF586C flex flex-center">
									<div v-if="v.salary_min>0">
									<span v-if="v.jobs_salary_show_type">{{v.salary_min}}-{{v.salary_max}}元</span>
									<span v-else>{{v.salary_min}}-{{v.salary_max}}k</span>
									<span v-if="v.salary_year>12">·{{v.salary_year}}薪</span>
									</div>
									<div v-else>面议</div>
								</div>
							</div>
							<div >
								<el-button type="info" size="mini" v-if="v.is_delivery"
								style="width: 80px;">已投递</el-button>
								<el-button type="primary" size="mini" @click="deliveryResume(v);" v-else="v.is_delivery"
								style="width: 80px;">投递简历</el-button>
								<div class="text-center pointer pt-3 text-FF8221" @click="toggleJobsCollection(v)" v-if="v.is_collection"><i class="el-icon-star-on mr-1"></i>取消收藏</div>
								<div class="text-center pointer pt-3 text-grey" @click="toggleJobsCollection(v)" v-if="!v.is_collection"><i class="el-icon-star-off mr-1"></i>收藏</div>
							</div>
						</div>
						<div class="flex flex-center text-grey">
							<div>
								<a :href="'/company/'+v.company_id+'.html'" target="_blank" class="el-link el-link--primary text-dark"><span class="text-primary-hover">{{v.scompany_name?v.scompany_name:v.company_name}}</span></a>
							</div>
							<div class="ml-3">
								{{v.industry}}
							</div>
							<div class="ml-3">
								{{v.size_type}}
							</div>
							<div class="flex-1"></div>
							<div class="text-grey">发布于{{v.friendly_create_time}}</div>
						</div>
					</div>
					<div class="px-4 py-2 bg-light" v-if="v.welfare.length>0">
						<el-tag type="primary" size="mini" v-for="welfare in v.welfare" class="mr-2">{{welfare}}</el-tag>
					</div>
				</div>
			</div>
			<el-table
		      :data="list"
		      style="width: 100%"
		      class="mt-3"
      		  header-cell-class-name="bg-light"
		      v-else>
		      <el-table-column
		        prop="title"
		        label="职位名称"
		        width="180">
		        <template slot-scope="scope">
				<a :href="'/jobs/'+scope.row.id+'.html'" target="_blank" class="h6 text-dark mb-0 flex flex-center" :class="{'text-danger':scope.row.urgent}">
					<div class="text-primary-hover">{{scope.row.title}}</div>
		  			<img src="__TEMPLATE_STATIC__/icon/icon_recommend.png" class="ml-1" height="22" v-if="scope.row.recommend">
		  			<img src="__TEMPLATE_STATIC__/icon/icon_urgent.png" class="ml-1" height="22" v-if="scope.row.urgent">
		  			<img src="__TEMPLATE_STATIC__/icon/icon_top.png" class="ml-1" height="22" v-if="scope.row.top">
				</a>
		        <div class="small text-grey pt-3"><i class="el-icon-location-outline"></i>{{scope.row.jobs_city}}·{{scope.row.jobs_area}}</div>
		        </template>
		      </el-table-column>
		      <el-table-column
		        label="公司名">
		        <template slot-scope="scope">
				<a :href="'/company/'+scope.row.company_id+'.html'" target="_blank" class="el-link text-secondary">{{scope.row.scompany_name?scope.row.scompany_name:scope.row.company_name}}</a>
		        </template>
		      </el-table-column>
		      <el-table-column
		        label="待遇"
		        width="160">
		        <template slot-scope="scope">
		        	<div v-if="scope.row.salary_min>0" class="font-weight-600 text-FF586C">
					<span class="text-FF586C" v-if="scope.row.jobs_salary_show_type">{{scope.row.salary_min}}-{{scope.row.salary_max}}元</span>
					<span class="text-FF586C" v-else>{{scope.row.salary_min}}-{{scope.row.salary_max}}k</span>
					<span v-if="scope.row.salary_year>12">·{{scope.row.salary_year}}薪</span>
		        	</div>
					<span v-else class="text-FF586C font-weight-600">面议</span>
		        </template>
		      </el-table-column>
		      <el-table-column
		        label="操作"
		        width="100">
		        <template slot-scope="scope">
					<el-button type="info" size="mini" v-if="scope.row.is_delivery"
					style="width: 80px;">已投递</el-button>
					<el-button type="primary" size="mini" @click="deliveryResume(scope.row);" v-else="scope.row.is_delivery"
					style="width: 80px;">投递简历</el-button>
		        	<div class="pt-3 small text-grey">{{scope.row.friendly_create_time}}</div>
		        </template>
		      </el-table-column>
		    </el-table>
			<div class="p-3 text-center text-secondary" v-if='list.length<=0&&!listViewType'>暂无数据</div>
			<div class="text-center mt-3 bg-white py-3 shadow" v-if='list.length>0'>
				<el-pagination
				  background
      			  @current-change="handleCurrentChange"
				  layout="prev, pager, next"
			      :page-size="search.per_page"
			      :current-page="search.page"
				  :total="search.total">
				</el-pagination>
			</div>	
		</div>
		<div class="w-350px">
			<div class="ads">
				{xycms:ads alias="search_jobs" name='v' length='3'}
		      	<div class="text-v-center shadow mb-3">
		      		{empty name="v.url"}
			      	<a title="{$v.title}" class="{$v.ads_icon?'ads-icon':''}">
		      		{else/}
			      	<a href="{$v.url}" class="s {$v.ads_icon?'ads-icon':''}" target="_blank" title="{$v.title}">
		      		{/empty}
						<img src="{xycms:web name="imgurl"/}{$v.path}" class="w-350px">
			      	</a>
		      	</div>
				{/xycms:ads}
			</div>
			{xycms:jobslist name="JobsList" new="1"}
			<div class="bg-white p-3 shadow">
				<div class="block-title-before pb-2">最新职位</div>
				{volist name="JobsList" id="v"}
				<a href="/jobs/{$v.id}.html" target="_blank" class="flex py-3 flex-center">
					<div class="border w-80px h-80px text-truncate rounded-lg border-grey">
						<img src="{$v.logo}" style="object-fit: contain;width: 100%;height: 100%;">
					</div>
					<div class="flex-1 pl-2">
						<h6 class="mb-1 text-dark text-truncate">{$v.title}</h6>
						<div class="h6 text-FF586C mb-3">
							{gt name="v.salary_min" value="0"}
							{eq name="v.jobs_salary_show_type" value="1"}
							{$v.salary_min}-{$v.salary_max}元
							{else/}
							{$v.salary_min}-{$v.salary_max}k
							{/eq}
							{else/}
							面议
							{/gt}
						</div>
						<div class="text-secondary flex">
							<div class="flex-1 text-truncate">
								{empty name="v.scompany_name"}
								{$v.company_name}
								{else/}
								{$v.scompany_name}
								{/empty}
							</div>
							<div class="text-grey">{$v.jobs_city}</div>
						</div>
					</div>
				</a>
				{/volist}
			</div>
			{/xycms:jobslist}
		</div>
	</div>
</div>
{/block}
{block name="footer"}
{include file="module/footer"/}
{include file="module/login"/}
{/block}
{block name="script"}
<script type="text/javascript">
	var salary=[
		{salary_min:0,salary_max:0},
		{salary_min:1000,salary_max:3000},
		{salary_min:3000,salary_max:5000},
		{salary_min:5000,salary_max:10000},
		{salary_min:10000,salary_max:20000},
		{salary_min:20000,salary_max:50000},
		{salary_min:50000,salary_max:100000},
		];
	var jobscatelist={xycms:jobscate serialize="json"/};
	var arealist={xycms:arealist serialize="json"/};
	var industry={xycms:industry serialize="json"/};
	var finance={xycms:statusalias name="company/finance" serialize="json"/};
	var size_type={xycms:statusalias name="company/size_type" serialize="json"/};
	var education_level={xycms:statusalias name="jobs/education_level" serialize="json"/};
	var exp_level={xycms:statusalias name="jobs/exp_level" serialize="json"/};
</script>
<script type="text/javascript">
	var vm=new Vue({
		el:'#app',
		data:{
			view:XYBase.view,
			loginTabs:XYBase.loginTabs,
			userInfo:UserInfo,
			feedback:XYBase.feedback,
			confirm:0,
			jobs_salary_show_type:{xycms:companyconfig name="jobs_salary_show_type"/},
			hoverCityKey:'A',
			showSearchBody:'',
			showAllCity:false,
			salary:salary,
			jobscatelist:jobscatelist,
			arealist:arealist,
			city:[],
			area:[],
			industry:industry,
			finance:finance,
			size_type:size_type,
			education_level:education_level,
			exp_level:exp_level,
			cid:[],
			offsetLeft:0,
			text:{
				industry:'',
				size_type:'',
				finance:'',
				education_level:'',
				exp_level:'',
			},
			jobs_type:[{value:1,title:'全职'},{value:2,title:'兼职'},{value:3,title:'实习'}],
			update_time:[{value:1,title:'今天以内'},{value:2,title:'三天以内'},{value:3,title:'七天以内'}],
			listViewType:false,
	        defaultProps: {
	          	value: 'id',
	          	label: 'title',
	          	children: 'data',
	        },
			search:{
				ajax:false,
				salary_min: {empty name=":request()->get('salary_min')"}null{else/}{:htmlentities(request()->get('salary_min'))}{/empty},
				salary_max: {empty name=":request()->get('salary_max')"}null{else/}{:htmlentities(request()->get('salary_max'))}{/empty},
				key:'{notempty name=":request()->get('key')"}{:htmlentities(request()->get('key'))}{/notempty}',
				cid:'{:request()->get('cid')}',
				company_id:{empty name=":request()->get('company_id')"}0{else/}{:htmlentities(request()->get('company_id'))}{/empty},
				province:'',
				city:'',
				area:'',
				industry:0,
				finance:'',
				size_type:'',
				jobs_type:'',
				education_level:'',
				exp_level:'',
				update_time:'',
				is_famous:0,
				prop:'default',
				per_page:10,
				current_page:0,
				last_page:0,
				total:0,
				page:{:htmlentities(request()->get('page',1))}
			},
			list:[]
		},
		watch:{
		    view:XYBase.viewWatch,
		    loginTabs:XYBase.loginTabsWatch,
		    listViewType(val,oldVal){
		    	if(val){
		    		XYBase.setCookie('jobsListViewType',1);
		    	}else{
		    		XYBase.delCookie('jobsListViewType');
		    	}
		    }
		},
		created(){
			this.initText();
			XYBase.created(this);
			this.listViewType=XYBase.getCookie('jobsListViewType')?true:false;
			this.initHtml();
		},
		methods:XYBase.methods({
			setSearchItemSalary(obj){
				if(obj){
					this.search.salary_min=obj.salary_min;
					this.search.salary_max=obj.salary_max;
				}else{
					this.search.salary_min=null;
					this.search.salary_max=null;
				}
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemCid(val){
				if (val) {
					this.search.cid=val[2];
				}else{
					this.search.cid='';
				}
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemCity(val){
			    if(val){
			    	this.showAllCity=true;
			        switch(val.level){
			            case 1:
					    this.search.city='';
					    this.search.area='';
				        this.search.province=val.id;
				        this.city=val.data;
			    		this.area=[];
			            break;
			            case 2:
					    this.search.area='';
				        this.search.city=val.id;
				        this.area=val.data;
			            break;
			            case 3:
				        this.search.area=val.id;
			            break;
			        }
			    }else{
			    	this.showAllCity=false;
				    this.search.province='';
				    this.search.city='';
				    this.search.area='';
			    	this.city=[];
			    	this.area=[];
			    }
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemWelfare(val){
				this.search.welfare=val;
				/*if (val) {
					if (this.search.welfare.length>=6) return  XYBase.msg('最多选择6项福利');
					var index=this.search.welfare.indexOf(val.value);
					if (index>-1) {
						this.search.welfare.splice(index,1);
					}else{
						this.search.welfare.push(val.value);
					}
				}else{
					this.search.welfare=[];
				}*/
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemIndustry(val){
				this.setShowSearchBody({srcElement:{offsetLeft:0}},'industry');
				this.text.industry=val.title;
				this.search.industry=val.id;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemFinance(val){
				this.setShowSearchBody({srcElement:{offsetLeft:0}},'finance');
				this.text.finance=val.title;
				this.search.finance=val.value;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemSizeType(val){
				this.setShowSearchBody({srcElement:{offsetLeft:0}},'size_type');
				this.text.size_type=val.title;
				this.search.size_type=val.value;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemJobsType(val){
				this.search.jobs_type=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemEducationLevel(val){
				this.setShowSearchBody({srcElement:{offsetLeft:0}},'education_level');
				this.text.education_level=val.title;
				this.search.education_level=val.value;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemExpLevel(val){
				this.setShowSearchBody({srcElement:{offsetLeft:0}},'exp_level');
				this.text.exp_level=val.title;
				this.search.exp_level=val.value;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemUpdateTime(val){
				this.search.update_time=val;
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemKey(){
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemProp(val){
				if(val==this.search.prop){
					this.search.prop=val+'asc';
				}else{
					this.search.prop=val;
				}
				this.search.page=1;
				this.initHtml();
			},
			setSearchItemIsFamous(val){
				this.search.is_famous=val;
				this.search.page=1;
				this.initHtml();
			},
			setShowSearchBody($event,el){
				return;
				this.offsetLeft=$event.srcElement.offsetLeft-10;
				if (el==this.showSearchBody) {
					this.showSearchBody='';
				}else{
					this.showSearchBody=el;
				}
			},
			clearSearchItem(){
				this.search.page=1;
				this.search.salary_min='';
				this.search.salary_max='';
				this.search.key='';
				this.search.city='';
				this.search.cid=0;
				this.search.industry=0;
				this.search.finance='';
				this.search.size_type='';
				this.search.jobs_type='';
				this.search.education_level='';
				this.search.exp_level='';
				this.search.update_time='';
				this.showSearchBody='';
				this.initText();
				this.initHtml();
			},
			initText(){
				this.text={
					industry:'所属行业',
					size_type:'企业规模',
					finance:'融资阶段',
					education_level:'学历要求',
					exp_level:'工作经验',
				}
			},
			handleCurrentChange(val){
				this.search.page=val;
				this.initHtml();
			},
			initHtml(){
				var _this=this;
				if (_this.search.ajax) return XYBase.msg('操作频繁，请稍后再试');
				_this.search.ajax=true;
				_this.sendGet({
					url:'/search/jobs',
					data:_this.search
				},function(ret){
					_this.search.ajax=false;
					if (ret) {
						_this.list=[];
						if (ret.code === 0) {
							_this.search.total=ret.data.total;
							_this.search.per_page=ret.data.per_page;
							_this.search.current_page=ret.data.current_page;
							_this.search.last_page=ret.data.last_page;
							_this.list=ret.data.data;
						}else{
							XYBase.msg(ret.msg);
							_this.search.current_page=0;
							_this.search.last_page=0;
						}
					}
				});
			},
		})
	});
</script>
{/block}